﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

class ThreeLightMachineGun : Weapon
{
    public ThreeLightMachineGun()
    {
        m_Price = 333;
        m_Type = ItemsType.WEAPON_MIDDLE_KINETICS_THREE_LIGHT_MACHINE_GUN;
        m_Speciality = Speciality.POINT_DEFENSE;
        ResearchInfluence = InfluenceMG.INFLUENCE_OTHER;
        ShutRange = 3.5f;
        ShutVelocity = 0.1f;
        BulletFlyVelocity = 10;
        Damage = 5f;
        TurnSpeed = 140f;
        m_DropRate = 0.18f;
        m_ExplotionScale = 0.3f;
        Name = "三管轻机枪";
        Perview = "Textures/Weapon/WeaponMiddle/ThreeLightMachineGun";
        WeaponResource = "Perfabs/Weapon/Middle/ThreeLightMachineGun";
        BulletResource = "Perfabs/Bullet/LiveBullet";
        m_FireAudioResouce = "Perfabs/Audio/Da";
        m_Level = Level.LEVEL_MIDDLE;
        Description = "加强版的轻机枪，密集的弹幕很难让飞行道具靠近";

    }
    public override FlyItem Fire(GameObject ship, WeaponSlot slot, Vector3 position, Vector3 direction)
    {
        if (ship)
            m_Ship = ship.GetComponent<Ship>();
        Slot = slot;
        var horizontalDir = Vector3.Cross(direction, new Vector3(0, 0, 1));
        var offset = horizontalDir * 0.1f;
        base.Fire(ship, Slot, position + offset, direction);
        offset = horizontalDir * -0.1f;
        base.Fire(ship, Slot, position + offset, direction);
        base.Fire(ship, Slot, position, direction);
        return null;
    }


}